SpatialStream® Code Examples

State Identify

Using State Boundaries, GetByGeometry, and GetMap SpatialStream® components, you can display state boundaries in your mapping application and use server-side highlight techniques to provide identify functionality. This example will demonstrate how to display state boundaries and add highlight behavior with information return in a balloon. The State Boundaries data component gives you access to nationwide state boundaries. The GetByGeometry component returns features at the mouse-click location, and GetMap displays the boundaries and the identified feature.

The advantage of the server-side highlight technique is that it gives you highly responsive interactivity with complex features and/or large data sets.

State Boundaries | GetMap | GetByGeometry

var state = new Dmp.Layer.WMSLayer("boundary", "SS", {
ignoreHoles: true, antiAlias: true
});
state.addChild("statePoly", "DMP_LICENSE/State", "$(ACCOUNT_FOLDER)SLD/SimpleBoundary.sld.xml", {
zoomRange: {
min: 2, max: 19
}
});
state.addChild("stateLabel", "DMP_LICENSE/State", "$(ACCOUNT_FOLDER)SLD/StateLabel.sld.xml", {
zoomRange: {
min: 5, max: 19
}
});
map.addLayer(state);

//----------------

var url = "getByGeometry.aspx" +
"?returnGeoType=1" +
"&dataSource=DMP_LICENSE/State" +
"&Geo=POINT(" + latLong.Longitude + " " + latLong.Latitude + ")" +
"&fields=NAME,_DMP_ID";
Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback);


Run Sample   View Video   Back To Index